Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes Webpack support, and additionally it tests Webpack in CI.
There were (surprisingly) quite a few changes that needed to be made to support this:
require('request')
needed to be isolated to its own file and then swapped with the-browser
version at that levelbrowserify-versionify
wasn't working at all with Webpack and was breaking the tests, since Webpack just left the'__VERSION__'
string in there as-is. So I swapped it out for a new Browserify transform that I wrote - package-json-versionify, which simply removes everything frompackage.json
except for"version"
. Webpack will ignore this transform, meaning that Webpack users are punished with a larger bundle size, but it still works.require('../package.json')
, Webpack loses its mind and you suddenly need ajson-loader
. AFAICT from this discussion, this is expected behavior and they intend for end-users to include custom loaders to deal with this stuff. So unfortunately our users are going to have to do that. Hopefully they've run into it enough times before that it won't surprise them. (WTF, why can't you justrequire()
a JSON file without any additional configuration?)I think moving forward it is super important that we test Webpack in CI, because I cannot believe how much bending over backwards you have to do to support it and Browserify simultaneously.